<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditRecetaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditRecetaLabel_idReceta}" for="idReceta" />
                    <h:inputText id="idReceta" value="#{recetaController.selected.idReceta}" title="#{bundle.EditRecetaTitle_idReceta}" required="true" requiredMessage="#{bundle.EditRecetaRequiredMessage_idReceta}"/>
                    <h:outputLabel value="#{bundle.EditRecetaLabel_fechaEmision}" for="fechaEmision" />
                    <h:inputText id="fechaEmision" value="#{recetaController.selected.fechaEmision}" title="#{bundle.EditRecetaTitle_fechaEmision}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditRecetaLabel_consultaidConsulta}" for="consultaidConsulta" />
                    <h:selectOneMenu id="consultaidConsulta" value="#{recetaController.selected.consultaidConsulta}" title="#{bundle.EditRecetaTitle_consultaidConsulta}" required="true" requiredMessage="#{bundle.EditRecetaRequiredMessage_consultaidConsulta}">
                        <f:selectItems value="#{consultaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{recetaController.update}" value="#{bundle.EditRecetaSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditRecetaViewLink}"/>
                <br />
                <h:commandLink action="#{recetaController.prepareList}" value="#{bundle.EditRecetaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditRecetaIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
